% convenience function for block n x kn matrices
% breaks X into n x n blocks for easier manipulation
function B = blockify(X)
	n = size(X,1);
	assert(mod(size(X,2),n)==0);
	k = size(X,2)/n;
	B = cell(1,k);
	for i=0:(k-1)
		B{i+1} = X(1:n,(1:n)+n*i);
	end
end
